package com.demo.zhlg.controller;

import com.demo.zhlg.util.Result;
import com.mybatisflex.codegen.dialect.impl.OracleJdbcDialect;
import com.mybatisflex.core.paginate.Page;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import com.demo.zhlg.entity.Ratings;
import com.demo.zhlg.service.RatingsService;

import java.io.Serializable;
import java.util.List;

/**
 *  控制层。
 *
 * @author lenovo
 * @since 2025-04-26
 */
@RestController
@RequestMapping("/ratings")
public class RatingsController {

    @Autowired
    private RatingsService ratingsService;

    @PostMapping("submitRating")
    public Object submitRating(@RequestBody Ratings rating){
        return ratingsService.submitRating(rating);
    }

    @GetMapping("getUserRatingStats")
    public Object getUserRatingStats(@RequestParam Integer userId){
        return ratingsService.getUserRatingStats(userId);
    }

    @GetMapping("getRatingsTo")
    public Object getRatings(){
        return ratingsService.getRatingsTo();
    }

    @GetMapping("getRatingsFrom")
    public Object getRatingsFrom(){
        return ratingsService.getRatingsFrom();
    }
}
